package com.leesche.zcsp.node.web.service;

import com.leesche.zcsp.node.web.model.PubDiscountCode;
import com.leesche.zcsp.node.web.model.PubDiscountCodeCriteria;
import com.leesche.zcsp.node.web.service.impl.data.read.InfoDiscountCountDto;
import com.leesche.zcsp.node.web.service.impl.data.read.PubDiscountCodeDto;
import com.leesche.zcsp.node.web.service.impl.data.read.QueryPubDiscountCodeCondition;

import java.util.List;

/**
 * Created by dennies yang on 2016-11-16.
 */
public interface PubDiscountCodeService extends BaseService<PubDiscountCode, PubDiscountCodeCriteria, PubDiscountCodeDto, QueryPubDiscountCodeCondition, Long> {
    /**
     * 检查是否已经有此优惠码
     * @return
     */
    boolean selectCheck(QueryPubDiscountCodeCondition codeCondition);

    /**
     * 查询优惠码对象
     * @param codeCondition
     * @return
     */
    PubDiscountCode selectByModel(QueryPubDiscountCodeCondition codeCondition);

    /**
     * 查询优惠码有效数量
     * @param codeCondition
     * @return
     */
    int selectCodeNum(QueryPubDiscountCodeCondition codeCondition);

    /**
     * 查询优惠码总数、未使用数、已使用数、已过期数
     * @param codeCondition
     * @return
     */
    List<InfoDiscountCountDto> selectCodeTypeNum(QueryPubDiscountCodeCondition codeCondition);

    /**
     * 条件查询优惠码列表
     * @param codeCondition
     * @return
     */
    List<PubDiscountCode> findListByCondition(QueryPubDiscountCodeCondition codeCondition);

    int insertBatch(List<PubDiscountCode> list);
}
